﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CMS.IRepository;


namespace CMS.Repository
{
    public class ClassRepository : IClassRepository
    {
        /// <summary>
        /// Selects all grades.
        /// </summary>
        /// <returns>List of Grade</returns>
        /// <remarks>RebeccaNiu</remarks>
        public List<CMS.Model.Grade> SelectAllGrades()
        {
            using (CMSEntities edm = new CMSEntities())
            {
                List<Class> grade = (from c in edm.Classes select c).ToList<Class>();
                List<CMS.Model.Grade> gradechange = Translator.ClassTranslator.ToClassModelList(grade);
                return gradechange;
            }
        }
    }
}
